From f2811866bc51a6d591370d6c788f74ee0d250461 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Thu, 28 Apr 2005 17:02:19 +0000 Subject: [PATCH] bitkeeper revision 1.1327.1.8 (4271171bkgG2OW7a1JXLin4JRIi6_Q) Code cleanup --- xen/arch/ia64/patch/linux-2.6.11/head.S | 51 ++++--------------------- xen/arch/ia64/tools/mkbuildtree | 14 ++++--- xen/arch/ia64/xenmisc.c | 29 +++++++++++--- xen/arch/ia64/xensetup.c | 34 ++++++----------- xen/include/asm-ia64/config.h | 9 +++-- 5 files changed, 56 insertions(+), 81 deletions(-) diff --git a/xen/arch/ia64/patch/linux-2.6.11/head.S b/xen/arch/ia64/patch/linux-2.6.11/head.S index cb98c3ee89..7cb47a60b8 100644 --- a/xen/arch/ia64/patch/linux-2.6.11/head.S +++ b/xen/arch/ia64/patch/linux-2.6.11/head.S @@ -1,20 +1,6 @@ - head.S | 34 ++++++++++++++++++++++++++++++++++ - 1 files changed, 34 insertions(+) - -Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S -=================================================================== ---- linux-2.6.11-xendiffs.orig/arch/ia64/kernel/head.S 2005-04-07 10:56:19.225128582 -0500 -+++ linux-2.6.11-xendiffs/arch/ia64/kernel/head.S 2005-04-07 11:00:21.718513399 -0500 -@@ -1,3 +1,8 @@ -+#ifdef XEN -+#define console_print printf -+#define kernel_thread_helper 0 -+#define sys_exit 0 -+#endif - /* - * Here is where the ball gets rolling as far as the kernel is concerned. - * When control is transferred to _start, the bootload has already -@@ -187,7 +192,11 @@ start_ap: +--- ../../linux-2.6.11/arch/ia64/kernel/head.S 2005-03-02 00:38:13.000000000 -0700 ++++ arch/ia64/head.S 2005-04-28 10:51:19.000000000 -0600 +@@ -187,7 +187,11 @@ dep r18=0,r3,0,12 ;; or r18=r17,r18 @@ -26,7 +12,7 @@ Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S ;; mov r17=rr[r2] shr.u r16=r3,IA64_GRANULE_SHIFT -@@ -227,7 +236,11 @@ start_ap: +@@ -227,7 +231,11 @@ ;; mov ar.rsc=0x3 // place RSE in eager mode @@ -38,29 +24,7 @@ Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S (isBP) movl r2=ia64_boot_param ;; (isBP) st8 [r2]=r28 // save the address of the boot param area passed by the bootloader -@@ -245,7 +258,21 @@ start_ap: - br.call.sptk.many rp=sys_fw_init - .ret1: - #endif -+#ifdef XEN -+ alloc r2=ar.pfs,8,0,2,0 -+ ;; -+#define fake_mbi_magic 0 -+#define MULTIBOOT_INFO_SIZE 1024 -+ .rodata -+fake_mbi: -+ .skip MULTIBOOT_INFO_SIZE -+ .previous -+ movl out0=fake_mbi -+ ;; -+ br.call.sptk.many rp=cmain -+#else - br.call.sptk.many rp=start_kernel -+#endif - .ret2: addl r3=@ltoff(halt_msg),gp - ;; - alloc r2=ar.pfs,8,0,2,0 -@@ -254,7 +281,9 @@ start_ap: +@@ -254,7 +262,9 @@ br.call.sptk.many b0=console_print self: hint @pause @@ -70,13 +34,12 @@ Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S END(_start) GLOBAL_ENTRY(ia64_save_debug_regs) -@@ -850,7 +879,12 @@ END(ia64_delay_loop) +@@ -850,7 +860,11 @@ * intermediate precision so that we can produce a full 64-bit result. */ GLOBAL_ENTRY(sched_clock) +#ifdef XEN -+ break 0;; // FIX IA64_CPUINFO_NSEC_PER_CYC_OFFSET -+ //movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET ++ movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET +#else addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0 +#endif diff --git a/xen/arch/ia64/tools/mkbuildtree b/xen/arch/ia64/tools/mkbuildtree index 55dd82066d..6ff9b80a95 100644 --- a/xen/arch/ia64/tools/mkbuildtree +++ b/xen/arch/ia64/tools/mkbuildtree @@ -97,7 +97,8 @@ cp_patch arch/ia64/kernel/vmlinux.lds.S arch/ia64/xen.lds.S lds.S #cp_patch mm/slab.c arch/ia64/slab.c slab.c # following renamed to avoid conflict -cp_patch kernel/extable.c arch/ia64/linuxextable.c linuxextable.c +#cp_patch kernel/extable.c arch/ia64/linuxextable.c linuxextable.c +softlink kernel/extable.c arch/ia64/linuxextable.c cp_patch arch/ia64/mm/contig.c arch/ia64/mm_contig.c mm_contig.c cp_patch arch/ia64/mm/tlb.c arch/ia64/tlb.c tlb.c @@ -168,7 +169,8 @@ softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h vml cp_patch arch/ia64/hp/sim/hpsim_ssc.h include/asm-ia64/hpsim_ssc.h hpsim_ssc.h -cp_patch include/asm-ia64/current.h include/asm-ia64/current.h current.h +#cp_patch include/asm-ia64/current.h include/asm-ia64/current.h current.h +softlink include/asm-ia64/current.h include/asm-ia64/current.h #cp_patch include/asm-ia64/gcc_intrin.h include/asm-ia64/gcc_intrin.h gcc_intrin.h softlink include/asm-ia64/gcc_intrin.h include/asm-ia64/gcc_intrin.h cp_patch include/asm-ia64/hardirq.h include/asm-ia64/hardirq.h hardirq.h @@ -180,7 +182,8 @@ cp_patch include/asm-ia64/irq.h include/asm-ia64/irq.h irq.h cp_patch include/asm-ia64/kregs.h include/asm-ia64/kregs.h kregs.h cp_patch include/asm-ia64/page.h include/asm-ia64/page.h page.h cp_patch include/asm-ia64/processor.h include/asm-ia64/processor.h processor.h -cp_patch include/asm-ia64/sal.h include/asm-ia64/sal.h sal.h +#cp_patch include/asm-ia64/sal.h include/asm-ia64/sal.h sal.h +softlink include/asm-ia64/sal.h include/asm-ia64/sal.h cp_patch include/asm-ia64/system.h include/asm-ia64/system.h system.h cp_patch include/asm-ia64/types.h include/asm-ia64/types.h types.h @@ -268,9 +271,10 @@ cp_patch include/linux/hardirq.h include/asm-ia64/linux/hardirq.h linuxhardirq.h cp_patch include/linux/interrupt.h include/asm-ia64/linux/interrupt.h interrupt.h cp_patch include/linux/mmzone.h include/asm-ia64/linux/mmzone.h mmzone.h -cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h +#cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h +softlink include/linux/wait.h include/asm-ia64/linux/wait.h -cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h +#cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h # following renamed to avoid conflict cp_patch include/linux/time.h include/xen/linuxtime.h linuxtime.h diff --git a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c index 382def35c1..16668ed49d 100644 --- a/xen/arch/ia64/xenmisc.c +++ b/xen/arch/ia64/xenmisc.c @@ -237,18 +237,35 @@ void physdev_destroy_state(struct domain *d) dummy(); } -// accomodate linux extable.c -//const struct exception_table_entry * -void *search_module_extables(unsigned long addr) +/////////////////////////////// +// called from arch/ia64/head.S +/////////////////////////////// + +void console_print(char *msg) { - return NULL; + printk("console_print called, how did start_kernel return???\n"); } -void *module_text_address(unsigned long addr) +void kernel_thread_helper(void) { - return NULL; + printk("kernel_thread_helper not implemented\n"); + dummy(); } +void sys_exit(void) +{ + printk("sys_exit not implemented\n"); + dummy(); +} + + + +// accomodate linux extable.c +//const struct exception_table_entry * +void *search_module_extables(unsigned long addr) { return NULL; } +void *__module_text_address(unsigned long addr) { return NULL; } +void *module_text_address(unsigned long addr) { return NULL; } + void cs10foo(void) {} void cs01foo(void) {} diff --git a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xensetup.c index 466e4ec629..a15b754d68 100644 --- a/xen/arch/ia64/xensetup.c +++ b/xen/arch/ia64/xensetup.c @@ -1,13 +1,9 @@ /****************************************************************************** - * kernel.c - * - * This file should contain architecture-independent bootstrap and low-level - * help routines. It's a bit x86/PC specific right now! - * - * Copyright (c) 2002-2003 K A Fraser + * xensetup.c + * Copyright (c) 2004-2005 Hewlett-Packard Co + * Dan Magenheimer */ -//#include #include #include #include @@ -20,11 +16,6 @@ //#include //#include #include -//#include -//#include -//#include -//#include -//#include #include #include @@ -84,7 +75,7 @@ char opt_physdev_dom0_hide[200] = ""; char opt_leveltrigger[30] = "", opt_edgetrigger[30] = ""; /* * opt_xenheap_megabytes: Size of Xen heap in megabytes, including: - * xen image + * xen image * bootmap bits * xen heap * Note: To allow xenheap size configurable, the prerequisite is @@ -147,10 +138,9 @@ static void __init do_initcalls(void) (*call)(); } -void cmain(multiboot_info_t *mbi) +void start_kernel(void) { unsigned char *cmdline; - module_t *mod = (module_t *)__va(mbi->mods_addr); void *heap_start; int i; unsigned long max_mem, nr_pages, firsthole_start; @@ -162,7 +152,8 @@ void cmain(multiboot_info_t *mbi) xen_pstart = ia64_tpa(KERNEL_START); /* Must do this early -- e.g., spinlocks rely on get_current(). */ - set_current(&idle0_exec_domain); + //set_current(&idle0_exec_domain); + ia64_r13 = (void *)&idle0_exec_domain; idle0_exec_domain.domain = &idle0_domain; early_setup_arch(&cmdline); @@ -170,7 +161,7 @@ void cmain(multiboot_info_t *mbi) /* We initialise the serial devices very early so we can get debugging. */ serial_init_stage1(); - init_console(); + init_console(); set_printk_prefix("(XEN) "); /* xenheap should be in same TR-covered range with xen image */ @@ -201,7 +192,7 @@ void cmain(multiboot_info_t *mbi) ia64_boot_param->initrd_size); ia64_boot_param->initrd_start = initial_images_start; printk("Done\n"); - + /* first find highest page frame number */ max_page = 0; efi_memmap_walk(find_max_pfn, &max_page); @@ -217,7 +208,7 @@ void cmain(multiboot_info_t *mbi) efi_memmap_walk(filter_rsvd_memory, init_boot_pages); efi_memmap_walk(xen_count_pages, &nr_pages); - printk("System RAM: %luMB (%lukB)\n", + printk("System RAM: %luMB (%lukB)\n", nr_pages >> (20 - PAGE_SHIFT), nr_pages << (PAGE_SHIFT - 10)); @@ -267,7 +258,7 @@ printk("About to call init_idle_task()\n"); { int i; for (i = 0; i < CLONE_DOMAIN0; i++) { - clones[i] = do_createdomain(i+1, 0); + clones[i] = do_createdomain(i+1, 0); if ( clones[i] == NULL ) panic("Error creating domain0 clone %d\n",i); } @@ -278,9 +269,6 @@ printk("About to call init_idle_task()\n"); set_bit(DF_PRIVILEGED, &dom0->d_flags); -//printk("About to call shadow_mode_init()\n"); -// shadow_mode_init(); - /* * We're going to setup domain0 using the module(s) that we stashed safely * above our heap. The second module, if present, is an initrd ramdisk. diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index 2b3d017cf9..1c34f40999 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -116,6 +116,9 @@ struct page; // avoid redefining task_t in asm/thread_info.h #define task_t struct domain +// avoid redefining task_struct in asm/current.h +#define task_struct exec_domain + // linux/include/asm-ia64/machvec.h (linux/arch/ia64/lib/io.c) #define platform_inb __ia64_inb #define platform_inw __ia64_inw @@ -177,8 +180,6 @@ struct pci_bus_region { unsigned long end; }; -// from linux/include/linux/module.h - // warning: unless search_extable is declared, the return value gets // truncated to 32-bits, causing a very strange error in privop handling struct exception_table_entry; @@ -232,7 +233,9 @@ void sort_main_extable(void); #define ARCH_HAS_EXEC_DOMAIN_MM_PTR -// see arch/x86/nmi.c !?!? +// from include/linux/preempt.h (needs including from interrupt.h or smp.h) +#define preempt_enable() do { } while (0) +#define preempt_disable() do { } while (0) // these declarations got moved at some point, find a better place for them extern int opt_noht; -- 2.30.2